package com.adjy.pathbuilders.rendering.loading;

import android.util.Log;


public class ImageDescription {
	
	String path;
	int width, height;
	
	public ImageDescription(String path, int width, int height) {
		this.path = path;
		this.width = width;
		this.height = height;
	}
	
	public ImageDescription(String[] description) {
		if (description.length == 0)
			throw new IllegalArgumentException();
		
		this.path = description[0];
		
		int width = -1;
		int height = -1;
		if (description.length > 2) {
			try {
			width = Integer.parseInt(description[1]);
			height = Integer.parseInt(description[2]);
			} catch (NumberFormatException e) {
				Log.e("NumberFormatException", "Path: " + this.path);
				width = -1;
				height = -1;
			}
		}
		
		this.width = width;
		this.height = height;
	}

	public ImageDescription(String path) {
		this(path, -1, -1);
	}
	
	public String getPath() {
		return path;
	}

	public int getWidth() {
		return width;
	}

	public int getHeight() {
		return height;
	}

}
